from django.contrib import admin
from django.db import models

from apps.baseData.models import BaseModel


class Banner(BaseModel):
    """轮播图"""
    img = models.CharField(max_length=255, verbose_name="图片的链接")
    title = models.CharField(max_length=255, blank=True, null=True, verbose_name="标题")
    path = models.CharField(max_length=255, blank=True, null=True, verbose_name="图片的跳转地址")
    bg_color = models.CharField(max_length=50, blank=True, default="White", verbose_name="背景颜色")

    class Meta:
        verbose_name = '首页轮播图'
        verbose_name_plural = verbose_name


class TabBarImage(BaseModel):
    """页面底部图标和文本"""
    img = models.CharField(max_length=255, verbose_name="未选中")
    active_img = models.CharField(max_length=255, verbose_name="已选中的图片")
    name = models.CharField(max_length=255, null=True, verbose_name="标签的名字")

    class Meta:
        verbose_name = 'app底部图标'
        verbose_name_plural = verbose_name


class Classify(BaseModel):
    """首页功能分类列表"""
    name = models.CharField(max_length=255, verbose_name="标签的名字")
    icon = models.CharField(max_length=255, verbose_name="标签的icon")
    page = models.CharField(max_length=255, verbose_name="跳转前端的页面url")
    message = models.CharField(max_length=255, null=True, verbose_name="标签的描述")

    class Meta:
        verbose_name = '标签'
        verbose_name_plural = verbose_name


admin.site.register([Banner, Classify, TabBarImage])
